#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_white_clicked()
{
    // 窗口颜色
    this->setStyleSheet("background-color:rgb(#F0F0F0);");
    // 设置文本框颜色
    ui->plainTextEdit->setStyleSheet("background-color:white; color:black;");
    // 设置按钮颜色
    ui->pushButton_white->setStyleSheet("color:black;");
    ui->pushButton_black->setStyleSheet("color:balck;");
}


void Widget::on_pushButton_black_clicked()
{
    // 窗口颜色
    this->setStyleSheet("background-color:black;");
    // 设置文本框颜色
    ui->plainTextEdit->setStyleSheet("background-color:balck; color:white;");
    // 设置按钮颜色
    ui->pushButton_white->setStyleSheet("color:white;");
    ui->pushButton_black->setStyleSheet("color:white;");
}

